package com.bocai.grainshop.product;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;


/**
 * @Author: SunJinbo
 * @Description  JSR303
 * 1.给Bean的字段添加校验注解：javax.validation.constraints,并定义自己的messages提示
 * 2.开启校验功能@Valid controller的请求字段前 效果：校验错误以后会有默认的响应
 * 3.给校验的bean后紧跟着一个BindingResult，就可以获取到校验的结果
 * ----------分组校验(多场景的复杂校验)
 *   1.Bean的字段上表注解@NotBlank(message=“”,groups={AddGroup.class})
 *   2.定义分组接口  无需要内容
 *   3.在Contrllor上 给需要校验的请求参数上打上@Validated({Addgroup.class})注解
 *   4.默认没有指定的分组的校验注解，在分组注解@Validated下不生效
 * @Param
 * @return
 * @Data Created in 2022/3/7 17:25
 */

@EnableFeignClients(basePackages = "com.bocai.grainshop.product.feign")
@MapperScan("com.bocai.grainshop.product.dao")
@SpringBootApplication
@EnableDiscoveryClient
public class GrainshopProductApplication {

    public static void main(String[] args) {
        SpringApplication.run(GrainshopProductApplication.class, args);
    }

}
